// 定时器运行方式
export type ITimerType = "interval" | "frame";
// 延迟时间
export type IDelay = number;
// 定时器句柄
export type IntervalId = NodeJS.Timeout | string | number | undefined;
// 处理函数
export type IHandle = (...args: unknown[]) => void;
// 定时器的函数列表
export type TimerItem = {
    id: string;
    handle: IHandle;
    delay?: IDelay;
};
// 定时器
export type Timer = {
    intervalId: IntervalId | Function;
    handles: TimerItem[];
    delay?: IDelay;
};

// 以延时时间为单位的多个定时器的集合
export type Timers = {
    [delay: IDelay]: Timer;
};

// 定时器配置
export type ITimerManagerOptions = {
    type: ITimerType;
    autoStop: boolean
};

